<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>100.0020.浏览器原理-20-async_await</title>
    <script>

      // window.onload = function(){
      //   console.log('js执行完成 , window context 退出');
      // }
    </script>
</head>
<body>
    <div>
        <div id="showRespDataId"></div>
        <hr><br><hr>
        <div id="showAllNet"></div>
    </div>
</body>
<script>
function* genDemo() {
    console.log(" 开始执行第一段 ")
    yield 'generator 1'
 
    console.log(" 开始执行第二段 ")
    yield 'generator 2'
 
    console.log(" 开始执行第三段 ")
    yield 'generator 3'
 
    console.log(" 执行结束 ")
    return 'generator 4'
}
 
console.log('main 0')
let gen = genDemo()
console.log(gen.next().value)
console.log('main 1')
console.log(gen.next().value)
console.log('main 2')
console.log(gen.next().value)
console.log('main 3')
console.log(gen.next().value)
console.log('main 4')
console.log('====================================')

// let p01 = new Promise((resolve , reject )=> {
//   resolve(100)
// })
// console.log(p01)
// p01.then((res)=>{
//   console.log(res);
//   console.log(p01)
// })
// p01.then((res)=>{
//   console.log(res);
//   console.log(p01)
// })
// p01.then((res)=>{
//   console.log(res);
//   console.log(p01)
// })

async function foo() {
    console.log('print foo')
}
console.log(foo());

</script>
</html>